package com.example.provider.controller;

import com.example.common.entity.Message;
import com.example.provider.service.ScheduleService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/schedule")
@Api(value = "项目进度controller", tags = {"项目进度相关接口"})
public class ScheduleController {
    @Autowired
    private ScheduleService scheduleService;

    @ApiOperation("项目进入开工状态")
    @ResponseBody
    @PostMapping("/start")
    public Message start(@RequestBody Map<String, Long> map){
        long ll = map.get("workroomId");
        return scheduleService.addSchedule(map.get("demandId"),
                Integer.parseInt(String.valueOf(ll)),
                Integer.parseInt(String.valueOf(map.get("companyId"))));
    }
}
